<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<title>用户中心</title>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>resources/css/basic.css">
		
		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/js/user_center.js"></script>
		<style type="text/css">
			#photo {
				width:50px;
				height:50px;
			}
			#welcome {
				font-size:18px;
			}
		</style>
	</head>
	<body ng-app="myApp" ng-controller="userCenterController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
			<span id="welcome"> 欢迎您，${user.username} </span>
			<img id="photo" alt="头像" src="${basePath}${user.photoUrl }"><br />
			<p><a href="${basePath }user/update-selfinfo/${user.userId}">修改个人信息</a></p>
		</div>
		<div id="container">
			<div><a href="${basePath}user/upload-headphoto">上传我的头像</a></div>
			<div><a href="${basePath}user/start-exam" title="">开始考试</a></div>
			<div>您的考试历史记录</div>
			<c:if test="${examList != null}">
				<div>
					<table class="table">
						<tr>
							<td>考试号</td>
							<td>得分</td>
							<td>结束时间</td>
							<td>开始时间</td>
							<td>操作</td>
						</tr>
						<c:forEach items="${examList }" var="exam">
							<tr>
								<td>${exam.examId }</td>
								<td>${exam.score }</td>
								<td>${exam.startTime }</td>
								<td>${exam.endTime }</td>
								<td>
									<a href="${basePath}exam/detail/${exam.examId}">查看详情</a>
								</td>
							</tr>
						</c:forEach>
					</table>
				</div>
			</c:if>
			<c:if test="${examList == null}">
				<div>您还未考过试!</div>
			</c:if>
		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>